import requests
from aip import AipOcr

#安装  aip 模块 pip install baidu-aip

image = requests.get('https://res.pandateacher.com/CLeWOrD_cLeBDPycJhdmXIsBPh6wOrD_h0niV1TEhJcITEKE.png').content

APP_ID = '15501832' #百度AI 开发平台的 AppID 
API_KEY = 'G7nzQ9b9XHie9c8gNOFtOFOu' #百度AI 开发平台的 API Key 
SECRET_KEY = 'rBb3wa4Uozkniid8N6iTMsHQyjlTOGHP' #百度AI 开发平台的 Secret Key 

client = AipOcr(APP_ID, API_KEY, SECRET_KEY)
res = client.basicGeneral(image)
if 'words_result' in res.keys():
    for item in res['words_result']:
        print(item['words'])
else:
    print(res)